package com.googlecode.particlesys.templates;

import java.awt.Color;
import java.util.Random;

import com.googlecode.particlesys.objects.AbstractEmitter;
import com.googlecode.particlesys.objects.Particle;

public class Burst extends AbstractEmitter {
	
	private static final Random RANDOM = new Random();

	public Burst(int x, int y){
		super(5, 5, x, y, 5, 0);
	}

	@Override
	public Particle getNextParticle(){
		Particle p = new Particle(Color.WHITE, width, height);
		p.setX(x);
		p.setY(y);
		p.setSpeed(7);
		p.setAngle(RANDOM.nextInt(360));
		p.setLife(35);
		return p;
	}
}